/**
  * Author: Mei
  * Date: 2020-12-25 9:36
  * Description: 线程的用法
  *
  */
#include "head.h"

using namespace std;

void func() {
    cout << "do some work" << endl;
}
void func1() {
    this_thread::sleep_for(chrono::seconds(1)); //休眠一秒
    cout << "do some work" << endl;
}

int main() {
    thread t(func);
    cout << t.get_id() << endl;
    cout << t.hardware_concurrency() << endl;

    thread tt(func1);

    tt.join();
    t.join();
    return 0;
}